import { h } from 'vue';
import { NTag } from 'naive-ui';
import { BasicColumn } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '序号',
    key: 'id',
    align: "center",
  }, {
    title: '会员号',
    key: 'member_card',
    align: "center",
  }, {
    title: '昵称',
    key: 'nick_name',
    align: "center",
  },{
    title: '余额',
    key: 'balance',
    align: "center",
  }, {
    title: '状态',
    key: 'is_delete',
    align: "center",
    render(row) {
      if (row.is_delete == 0) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('正常'),
          },
        );
      } else if (row.is_delete == 1) {
        return h(
          NTag,
          {
            type: 'error',
          },
          {
            default: () => ('禁用'),
          },
        );
      }
    }
  }, {
    title: '注册日期',
    key: 'add_date',
    align: "center",
  },
];
